package com.baichang.taoshunda.dao.impl;

import com.baichang.framework.model.Page;
import org.springframework.stereotype.Repository;

import com.baichang.framework.dao.impl.BaseDaoImpl;
import com.baichang.taoshunda.dao.CommonProblemDao;
import com.baichang.taoshunda.entity.CommonProblem;

import java.util.List;
import java.util.Map;

@Repository
public class CommonProblemDaoImpl extends BaseDaoImpl<CommonProblem> implements CommonProblemDao {
    /**
     * @return
     */
    @Override
    public List<Map<String, Object>> queryAnswer(Integer type) {
        String sql = "SELECT * FROM {table} WHERE type=?";
        return queryForMapList(sql,type);
    }

    /**
     * @param map
     * @param id
     * @return
     */
    @Override
    public int update(Map map, Integer id) {
        String sql = "id=?";
        return update(sql, map, id);
    }

    /**
     * @param nowPage
     * @param pageSize
     * @return
     */
    @Override
    public Page queryProblem(int nowPage, int pageSize) {
        String sql = "SELECT * FROM {table}";
        return pageForBeanList(sql, nowPage, pageSize);
    }
}